<template>
	<view>
		<view class="mianmibar">
			<view class="flex_row">
				<image :src="user.headphoto" mode="aspectFit"></image>
				<view style="font-size: 28upx;font-weight: 400;">{{ user.nickname }}</view>
			</view>
			<u-button size="mini" @click="toPage('/pagesB/pages/my/stylistInfo?role=user')">编辑</u-button>
		</view>
		
		<!-- 工具栏 -->
		<view class="toolbar">
			<view class="list">
				<view class="box" v-for="(row,index) in mytoolbarList" :key="index" @tap="toPage(row.url)">
					<view class="img">
						<image :src="row.img" mode="aspectFit"></image>
					</view>
					<view class="text">{{row.text}}</view>
				</view>
			</view>
		</view>
		
		<!-- 开通免密支付 -->
		<!-- <view class="mianmibar" hover-class="opacity7">
			<view style="font-size: 30upx;font-weight: bold;">开通免密支付</view>
			<view class="row">
				<view class="title">
					<span>快速开启免密支付</span>
				</view>
				<view class="right">
					<view class="icon xiangyou"></view>
				</view>
			</view>
		</view> -->
		
		<!-- 操作栏 -->
		<view class="bottom_list">
			<view class="row" @click="toPage('/pagesB/pages/my/userInfoPage')">
				<view class="title">
					<image src="../../static/img/user/info.png" mode="aspectFit"></image>
					<span>编辑穿搭资料</span>
				</view>
				<view class="right">
					<view class="icon xiangyou"></view>
				</view>
			</view>
			<view class="row" @click="toPage('/pagesB/pages/my/collection')">
				<view class="title">
					<image src="../../static/img/user/love.png" mode="aspectFit"></image>
					<span>收藏</span>
				</view>
				<view class="right">
					<view class="icon xiangyou"></view>
				</view>
			</view>
			<view class="row" @click="toPage('/pagesB/pages/my/setting')">
				<view class="title">
					<image src="../../static/img/user/setting.png" mode="aspectFit"></image>
					<span>设置</span>
				</view>
				<view class="right">
					<view class="icon xiangyou"></view>
				</view>
			</view>
			<view class="row" @click="toPage('/pages/feedback')">
				<view class="title">
					<image src="../../static/img/user/feedback.png" mode="aspectFit"></image>
					<span>反馈</span>
				</view>
				<view class="right">
					<view class="icon xiangyou"></view>
				</view>
			</view>
		</view>
		<!-- 占位 -->
		<view class="place-bottom"></view>
	</view>
</template>
<script>

	export default {
		data() {
			return {
				//个人信息,
				user: {
					nickname:'游客',
					headphoto: ''
				},
				// 工具栏列表
				mytoolbarList:[
					{url:'/pages/order/order_list/order_list',text:'我的订单',img:'../../static/img/user/order.png'},
					{url:'/pagesB/pages/my/myWearPlan',text:'搭配方案',img:'../../static/img/user/fangan.png'}, 
					// {url:'',text:'优惠券',img:'/static/img/user/youhuiquan.png'},
				]
			}
		},
		onShow() {
			if(uni.getStorageSync('userInfo')) {
				let userInfo = uni.getStorageSync('userInfo')
				this.user.nickname = userInfo.nickname
				this.user.headphoto = userInfo.headphoto
			}
		},
		methods: {
			toPage(url){
				uni.navigateTo({
					url: url
				})
			},
		}
	} 
</script>
<style lang="scss">
	page{
		position: relative;
		background-color: #f4f4f4;
	}
	
	.header{
		width: 100%;
		height: 407upx;
		background-color: #FFFFFF;
		padding: 10upx 0 32upx 0;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: space-evenly;
		&_img {
			width: 216upx;
			height: 216upx;
			image{
				width: 100%;
				height: 100%;
				border-radius: 20upx;
			}
		}
		&_name {
			font-size: 36upx;
			font-weight: bold;
		}
		&_intro {
			font-size: 26upx;
			color: #666666;
		}
	}
	.place{
		background-color: #FFFFFF;
		height: 100upx;
	}
	.place-bottom{
		height: 300upx;
	}
	

	.toolbar{
		margin: 20upx 30upx 20upx 30upx;
		padding: 25upx 163upx 32upx 163upx;
		background-color: #fff;
		.list{
			display: flex;
			flex-wrap: wrap;
			align-items: center;
			justify-content: space-between;
			.box{
				.img{
					display: flex;
					justify-content: center;
					image{
						width: 9vw;
						height: 9vw;
					}
				}
				.text{
					padding-top: 6upx;
					display: flex;
					justify-content: center;
					font-size: 28upx;
					color: #222222;
				}
			}
		}
	}
	
	.mianmibar {
		margin: 32upx 30upx 28upx 30upx;
		padding: 20upx;
		display: flex;
		flex-direction: row;
		background: #FFFFFF;
		border-radius: 12upx;
		justify-content: space-between;
		align-items: center;
		image {
			width: 84upx;
			height: 84upx;
			border-radius: 50%;
			margin-right: 16upx;
		}
	}
	
	.bottom_list {
		margin: 0upx 30upx 0 30upx;
		padding: 10upx 0;
		background-color: #fff;
		.row {
			display: flex;
			align-items: center;
			justify-content: space-between;
			background-color: #fff;
			padding: 19upx 20upx 19upx 20upx;
			.title {
				font-size: 28upx;
				color: #333333;
				display: flex;
				align-items: center;
				image {
					width: 35upx;
					height: 35upx;
					margin-right: 20upx;
				}
			}
	
			.right {
				display: flex;
				align-items: center;
				color: #999;
				.icon {
					width: 42upx;
					color: #909090;
					font-size: 23upx;
				}
			}
	
		}
	}
</style>
